package com.shou.types.exception;

import com.shou.types.common.ReturnCodeEnum;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * ClassName:InvalidParameterException
 * Project:SmartPark
 * Package: com.shou.types.exception
 * Description
 *
 * @Author Nemo
 * @Create 2025/2/17 22:27
 * @Version 1.0
 */
public class InvalidParameterException extends BusinessException{
    @Getter
    @AllArgsConstructor
    public enum ErrorCodeEnum {
        INVALID_INPUT_PASSWORD("C-CLI-01-01", "密码错误！"),
        INVALID_SPACE_CODE("C-CLI-01-01", "车位编号无效！"),
        INVALID_USER_ROLE("C-CLI-02-01", "用户角色信息无效！");

        private final String errorCode;
        private final String message;
    }
    public InvalidParameterException(InvalidParameterException.ErrorCodeEnum errorCodeEnum, ReturnCodeEnum httpStatus) {
        super(errorCodeEnum.getErrorCode(), errorCodeEnum.getMessage(), httpStatus);
    }
    public InvalidParameterException(InvalidParameterException.ErrorCodeEnum errorCodeEnum, String description, ReturnCodeEnum httpStatus) {
        super(errorCodeEnum.getErrorCode(), errorCodeEnum.getMessage() + description, httpStatus);
    }
}
